package com.hy.admin.service;

import java.util.List;

import org.springframework.web.multipart.MultipartFile;

import com.github.pagehelper.PageInfo;
import com.hy.admin.entity.MemberQuestionEntity;
import com.hy.admin.entity.QuestionEntity;
import com.hy.admin.helper.response.QuestionResponse;
import com.hy.core.response.ServicesResult;

/**
 * Created by yangqq on 18/4/5.
 */
public interface QuestionService {
    /**
     * 查询用户所有提问的问题
     * @param memberId
     * @return
     */
    ServicesResult<List<MemberQuestionEntity>> listByMemberId(Long memberId, Integer queState, Integer pageNum, Integer pageSize);

    /**
     * 获取向某教师提出的所有问题
     * @param teacherId
     * @return
     */
    ServicesResult<List<MemberQuestionEntity>> listByTeacherId(Long teacherId, Integer queState, Integer pageNum, Integer pageSize);

    /**
     * 精选问题
     * @param pageNum
     * @param pageSize
     * @return
     */
    ServicesResult<List<MemberQuestionEntity>> listByIsChoice(Integer pageNum, Integer pageSize);

    /**
     * 设置课程为精选课程
     * @param id
     * @return
     */
    ServicesResult<Boolean> updateChoice(Long id, Integer isChoice);

    /**
     * 教师已回答的所有公开问题
     * @param pageNum
     * @param pageSize
     * @return
     */
    ServicesResult<List<MemberQuestionEntity>> listByTeacherIdAndIsPublic(Long teacherId, Integer pageNum, Integer pageSize);
    ServicesResult<QuestionResponse> detail(Long memberId, Long id);

    /**
     * 提问
     * @param questionEntity
     * @param files
     * @return
     */
    ServicesResult<Boolean> add(QuestionEntity questionEntity, MultipartFile[] files) throws Exception;
    
    /**
     * 分页查询教师问题列表
     * <p>Title: listByTeacherId</p>  
     * <p>Description: </p>  
     * @param teacherId
     * @param pageNum
     * @param pageSize
     * @return
     */
    PageInfo<MemberQuestionEntity> listByTeacherId(Long teacherId, Integer pageNum, Integer pageSize);

    /**
     * 点赞
     * @param questionId
     * @param memberId
     * @return
     */
    ServicesResult<Boolean> like(Long questionId, Long memberId) throws Exception;
}
